package string;

import java.util.Random;

public class StartsWithDemo {
    public static void main(String[] args) {
        String a="fgfgfgfg";
        System.out.println(a.startsWith("f"));
        System.out.println(a.endsWith("g"));
        System.out.println(a.charAt(4));
        String str="1234567890zxcvbnmafjksdlghqwriopeyurt";
        int index;
        for ( int i=1;i<=4;i++){
            index=(int)(Math.random()*str.length());
            System.out.print(str.charAt(index));
        }
    }
}
